package com.visionet.school.app.web.repository.dynamic;

import com.visionet.school.app.web.entity.dynamic.DynamicContent;
import com.visionet.school.app.web.entity.dynamic.DynamicLikes;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

/**
 * Created by hxpeng on 2017/4/21.
 */
@Repository
public interface DynamicLikesRepository extends PagingAndSortingRepository<DynamicLikes,String>,JpaSpecificationExecutor<DynamicLikes> {

    @Query("from DynamicLikes as d where d.dynamicId = ?1 and d.memberId = ?2 and d.isDeleted = 0")
    DynamicLikes hadLikes(String dynamicId, String memberId);

}
